<?php foreach($models as $key => $model): ?><?php if($key == 0): ?><a href="<?php echo $model->category_id; ?>" target="_blank"><?php echo $model->category_name; ?></a><?php else: ?>|<a href="<?php echo $model->category_id; ?>" target="_blank"><?php echo $model->category_name; ?></a><?php endif; ?>
<?php endforeach; ?>